package com.ssy.common.utils;

import com.ssy.common.CodeMsg;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author ssy
 * <p>
 * 分页封装
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PageResult {

    private Integer code;

    private String msg;

    private long count = 0L;

    private Object data;


    public Object getData() {
        return data;
    }

    public PageResult(Object data) {
        this.code = CodeMsg.SUCCESS.CODE;
        this.msg = CodeMsg.SUCCESS.MSG;
        this.data = data;
    }

    public PageResult(long count, Object data) {
        this.code = CodeMsg.SUCCESS.CODE;
        this.msg = CodeMsg.SUCCESS.MSG;
        this.count = count;
        this.data = data;
    }

}
